.class public Lrexsee/core/browser/clazz/DomainWhiteList;
.super Ljava/lang/Object;
.source "DomainWhiteList.java"


# instance fields
.field private final list:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 18
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 13
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mBrowser:Lrexsee/core/browser/Browser;

    .line 19
    iput-object p1, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mContext:Landroid/content/Context;

    .line 20
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    .line 21
    return-void
.end method

.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 1
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 15
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Lrexsee/core/browser/clazz/DomainWhiteList;-><init>(Landroid/content/Context;)V

    .line 16
    iput-object p1, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mBrowser:Lrexsee/core/browser/Browser;

    .line 17
    return-void
.end method

.method private add(Ljava/lang/String;)V
    .locals 1
    .param p1, "domain"    # Ljava/lang/String;

    .prologue
    .line 26
    if-eqz p1, :cond_0

    const-string v0, ""

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 27
    iget-object v0, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 29
    :cond_0
    return-void
.end method

.method private add([Ljava/lang/String;)V
    .locals 3
    .param p1, "domains"    # [Ljava/lang/String;

    .prologue
    .line 31
    if-eqz p1, :cond_0

    .line 32
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    array-length v1, p1

    if-lt v0, v1, :cond_1

    .line 35
    .end local v0    # "i":I
    :cond_0
    return-void

    .line 33
    .restart local v0    # "i":I
    :cond_1
    iget-object v1, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    aget-object v2, p1, v0

    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 32
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method


# virtual methods
.method public contains(Ljava/lang/String;)Z
    .locals 1
    .param p1, "domain"    # Ljava/lang/String;

    .prologue
    .line 58
    iget-object v0, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v0

    return v0
.end method

.method public getList()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 23
    iget-object v0, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    return-object v0
.end method

.method public inherit()V
    .locals 4

    .prologue
    .line 37
    iget-object v3, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mBrowser:Lrexsee/core/browser/Browser;

    if-nez v3, :cond_1

    .line 38
    new-instance v1, Lrexsee/core/application/RexseeApplication;

    iget-object v3, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mContext:Landroid/content/Context;

    invoke-direct {v1, v3}, Lrexsee/core/application/RexseeApplication;-><init>(Landroid/content/Context;)V

    .line 39
    .local v1, "application":Lrexsee/core/application/RexseeApplication;
    invoke-virtual {v1}, Lrexsee/core/application/RexseeApplication;->getCurrentHome()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-virtual {v3}, Landroid/net/Uri;->getHost()Ljava/lang/String;

    move-result-object v3

    invoke-direct {p0, v3}, Lrexsee/core/browser/clazz/DomainWhiteList;->add(Ljava/lang/String;)V

    .line 40
    iget-object v3, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->domainWhiteList:[Ljava/lang/String;

    invoke-direct {p0, v3}, Lrexsee/core/browser/clazz/DomainWhiteList;->add([Ljava/lang/String;)V

    .line 56
    .end local v1    # "application":Lrexsee/core/application/RexseeApplication;
    :cond_0
    :goto_0
    return-void

    .line 43
    :cond_1
    iget-object v3, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->parentBrowser:Lrexsee/core/browser/Browser;

    if-nez v3, :cond_2

    .line 44
    iget-object v3, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    invoke-virtual {v3}, Lrexsee/core/application/RexseeApplication;->getCurrentHome()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v3

    invoke-virtual {v3}, Landroid/net/Uri;->getHost()Ljava/lang/String;

    move-result-object v3

    invoke-direct {p0, v3}, Lrexsee/core/browser/clazz/DomainWhiteList;->add(Ljava/lang/String;)V

    .line 45
    iget-object v3, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v3, v3, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v3, v3, Lrexsee/core/application/Resource;->domainWhiteList:[Ljava/lang/String;

    invoke-direct {p0, v3}, Lrexsee/core/browser/clazz/DomainWhiteList;->add([Ljava/lang/String;)V

    goto :goto_0

    .line 47
    :cond_2
    iget-object v3, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->parentBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v3, Lrexsee/core/browser/Browser;->domainWhiteList:Lrexsee/core/browser/clazz/DomainWhiteList;

    .line 48
    .local v0, "appendList":Lrexsee/core/browser/clazz/DomainWhiteList;
    iget-object v3, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->clear()V

    .line 49
    if-eqz v0, :cond_0

    .line 50
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_1
    iget-object v3, v0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-ge v2, v3, :cond_0

    .line 51
    iget-object v3, v0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    invoke-direct {p0, v3}, Lrexsee/core/browser/clazz/DomainWhiteList;->add(Ljava/lang/String;)V

    .line 50
    add-int/lit8 v2, v2, 0x1

    goto :goto_1
.end method

.method public isValidUrl(Ljava/lang/String;)Z
    .locals 2
    .param p1, "url"    # Ljava/lang/String;

    .prologue
    const/4 v1, 0x1

    .line 61
    iget-object v0, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    if-gt v0, v1, :cond_0

    move v0, v1

    .line 62
    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lrexsee/core/browser/clazz/DomainWhiteList;->list:Ljava/util/ArrayList;

    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    invoke-virtual {v1}, Landroid/net/Uri;->getHost()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->contains(Ljava/lang/Object;)Z

    move-result v0

    goto :goto_0
.end method
